import request from '@/utils/request'

const sysRoleApi = {
  Index: '/sys-role/index',
  Save: '/sys-role/save',
  Del: '/sys-role/destroy'
}

/**
 * 载入角色数据
 * @returns {requestPromise}
 */
export function getList (searcmParams = {}) {
    return request({
        url: sysRoleApi.Index,
        method: 'get',
        params: searcmParams
    })
}
/**
 * 保存角色数据
 * @param postData
 * @returns {requestPromise}
 */
export function saveData (postData = {}) {
    return request({
        url: sysRoleApi.Save,
        method: 'post',
        data: postData
    })
}

/**
 * 删除角色
 * @param groupId
 * @returns {requestPromise}
 */
export function delData (roleIds) {
    return request({
        url: sysRoleApi.Del,
        method: 'post',
        data: { ids: roleIds }
    })
}
